package com.woniu.his.bms.client;

import com.woniu.his.bms.client.param.FindSettlementCatParam;
import com.woniu.his.bms.client.param.UpdateSettlementCatParam;
import com.woniu.his.bms.client.result.PageSettlementCatResult;
import com.woniu.his.bms.client.result.SettlementCatResult;
import com.woniu.his.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "settlementCatClient",name="bms",path="bms")
public interface SettlementCatClient {

    /**
     * 新增结算类别
     *
     * @param name 名字
     * @return {@link Result}
     */
    @GetMapping("/addSettlementCat")
    public Result addSettlementCat(@RequestParam("name") String name);


    /**
     * 删除结算类别
     *
     * @param ids id
     * @return {@link Result}
     */
    @GetMapping("/deleteSettlementCat")
    public Result deleteSettlementCat(@RequestParam("ids") List<Long> ids);

    /**
     * 通过条件找到结算类别（模糊查询）
     *
     * @param param 参数
     * @return {@link Result}<{@link PageSettlementCatResult}>
     */
    @PostMapping("/findSettlementCatByCondition")
    public Result<PageSettlementCatResult> findSettlementCatByCondition(@RequestBody FindSettlementCatParam param);

    /**
     * 查询所有结算类别
     *
     * @return {@link Result}<{@link List}<{@link SettlementCatResult}>>
     */
    @GetMapping("/queryAllSettlementCat")
    public Result<List<SettlementCatResult>> queryAllSettlementCat();

    /**
     * 更新结算类别
     *
     * @param param 参数
     * @return {@link Result}
     */
    @PostMapping("/updateSettlementCatByCondition")
    public Result updateSettlementCatByCondition(@RequestBody UpdateSettlementCatParam param);

}
